package com.example.score.service;

import com.example.score.entity.Course;
import com.example.score.entity.Scale;
import com.example.score.mapper.CourseMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CourseService {
    @Resource
    private CourseMapper courseMapper;
    public int create(Course course) {
        return courseMapper.create(course);
    }
    public List<Course> getListByUserId(Integer userId) {
        return courseMapper.getListByUserId(userId);
    }
    public List<Course> getAllCourse(){
        return courseMapper.getAllCourse();
    }

    public Scale selectScale(Integer classId) {
        return courseMapper.selectScale(classId);
    }

    public int manage(Course course) {
        return courseMapper.manage(course);
    }

    public List<Course> showCourse(Integer courseId) {
        return courseMapper.showCourse(courseId);
    }

    public int RemoveCourseClass(Integer CourseId,Integer ClassId) {
        return courseMapper.RemoveCourseClass(CourseId,ClassId);
    }

    public int deleteCourse(Integer CourseId){
        int delete1 = courseMapper.deleteCourse1(CourseId);
        int delete2 = courseMapper.deleteCourse2(CourseId);
        return delete2;
    }


}
